package thomas.springmvc.ajax.constants;



import java.math.BigInteger;




public final class SystemHWUtil {
	public static final String OSNAME = System.getProperty("os.name");
	public static final String OSARCH = System.getProperty("os.arch");
	public static final String SEPARATOR = System.getProperty("file.separator");
	public static final String USER_DIR = System.getProperty("user.dir");
	/***
	 * 操作系统临时目录:C:\Users\huangwei\AppData\Local\Temp\
	 */
	public static final String SYSTEM_TEMP_FOLDER = System
			.getProperty("java.io.tmpdir");
	public static final String CURR_ENCODING = System
			.getProperty("file.encoding");
	public static final String LINE_SEPARATOR = System
			.getProperty("line.separator");
	public static final String CRLF = LINE_SEPARATOR; // Carriage Return/Line
	// Feed
	public static final String CRLF_LINUX = "\n";
	public static final String CRLF_WINDOW = "\r\n";
	public static final String CHARSET_UTF = "UTF-8";
	public static final String CHARSET_GBK = "GBK";
	public static final String CHARSET_GB2312 = "GB2312";
	public static final String CHARSET_GB18030 = "GB18030";
	public static final String CHARSET_UNICODE = "UNICODE";
	public static final String CHARSET_ISO88591 = "ISO-8859-1";
	public static final String[] CHARSET_ARRAY = new String[] { CHARSET_UTF,
			CHARSET_GBK, CHARSET_GB2312 };

	public static boolean isWindows = false;
	public static boolean isHP_UX = false;
	public static boolean isSolaris = false;
	public static boolean isOS32bit = true;
	public static final int BUFF_SIZE = 4096;
	public static final int BUFF_SIZE_1024 = 1024;
	public static final int SIZE_K=BUFF_SIZE_1024;
	/***
	 * MB 的字节个数
	 */
	public static final int SIZE_M=BUFF_SIZE_1024*BUFF_SIZE_1024;
	public static final String KEY_ALGORITHM_RSA = "RSA";
	public final static String KEY_ALGORITHM_DES = "DES";
	public static final String KEY_ALGORITHM_SHA1withRSA = "SHA1withRSA";
	public static final String KEY_SHA = "SHA";
	public static final String KEY_SHA1 = "SHA-1";
	public static final String KEY_MD5 = "MD5";
	public static final String KEY_HMAC_SHA256 = "HMACSHA256";
	public static final String KEY_HMAC_SHA1 = "HmacSHA1";
	public static final String CERTIFICATEFACTORY_X509 = "X.509";
	public static final char[] HEXCHAR = { '0', '1', '2', '3', '4', '5', '6',
			'7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f' };
	public static BigInteger BIGINT1 = BigInteger.valueOf(1l);
	public static final String CONTENTTYPE_HTML = "text/html";
	public static final String CONTENTTYPE_JSON = "application/json";
	public static final String CONTENTTYPE_X_WWW_FORM_URLENCODED = "application/x-www-form-urlencoded";

	public static final String CONTENTTYPE_OCTET_STREAM = "application/octet-stream";
	/***
	 * 应答(response)中的Content-Type:网页
	 */
	public static final String RESPONSE_CONTENTTYPE_HTML="text/html";
	/**
	 * 应答(response)中的Content-Type:普通文本
	 */
	public static final String RESPONSE_CONTENTTYPE_PLAIN="text/plain";
	/***
	 * 应答(response)中的Content-Type:json,UTF-8编码
	 */
	public static final String RESPONSE_CONTENTTYPE_JSON_UTF="application/json;charset=UTF-8";
	/***
	 * 应答(response)中的Content-Type:json,GBK编码
	 */
	public static final String RESPONSE_CONTENTTYPE_JSON_GBK="application/json;charset=GBK";
	/***
	 * 应答(response)中的Content-Type:二进制文件,例如
	 */
	public static final String RESPONSE_CONTENTTYPE_BINARY="application/octet-stream";
	public static final String RESPONSE_CONTENTTYPE_JAVASCRIPT="application/javascript";
	/***
	 * 兼容性比上面的更好
	 */
	public static final String RESPONSE_CONTENTTYPE_JAVASCRIPT2="text/javascript";
	/***
	 * JPG图片
	 */
	public static final String RESPONSE_CONTENTTYPE_JPEG="image/jpeg";
	/***
	 * png图片
	 */
	public static final String RESPONSE_CONTENTTYPE_PNG="image/png";
	public static final String RESPONSE_CONTENTTYPE_SWF="application/x-shockwave-flash";
	public static final String PROCOTOL_HTTP = "http";
	public static final String PROCOTOL_HTTPS = "https";
	public static final String COLON = ":";
	/**
	 * 字符串空格
	 */
	public static final String BLANK = " ";
	/***
	 * 英文句点
	 */
	public static final String ENGLISH_PERIOD = ".";
	/***
	 * "0"
	 */
	public static final String ZERO_STRING = "0";
	public static final String DIVIDING_LINE = "---------------------------------------";
	/***
	 * -1
	 */
	public static final int NEGATIVE_ONE = -1;
	/***
	 * 空字符串:""
	 */
	public static final String EMPTY = "";
	/***
	 * 逗号
	 */
	public static final String ENGLISH_COMMA = ",";
	public static final String SWING_DIALOG_RED = "<font color=\"red\"  style=\"font-weight:bold;\">%s</font>";
	public static final String SWING_DIALOG_BLUE = "<font color=\"blue\"  style=\"font-weight:bold;\">%s</font>";
	public static final String BR_HTML = "<br />";
	public static final String LABEL_BROWSE = "浏览";
	public static final String LABEL_PASTE = "粘贴";
	public static final String LABEL_CLEANUP = "清空";
	/***
	 * 下划线
	 */
	public static final String UNDERLINE = "_";
	/***
	 * 100
	 */
	public static final int NUMBER_100 = 100;
	/***
	 * the ascci of blank space
	 */
	public static final byte BLANK_BYTE = (byte) 32;
	public static final String  KEY_HEADER_COOLIE="Set-Cookie";
	static {
		if (SystemHWUtil.OSNAME.toLowerCase().contains("window")) {
			isWindows = true;
		}
		if (SystemHWUtil.OSNAME.toLowerCase().contains("hp-ux")) {
			isHP_UX = true;
		}
		if (SystemHWUtil.OSNAME.toLowerCase().contains("Solaris")) {
			isSolaris = true;
		}
		if (SystemHWUtil.OSARCH.contains("64")) {
			isOS32bit = false;
		}
	}

	/***
	 * the unit of file size
	 */
	public static final String[] UNIT_SIZE = { "B", "KB", "MB", "GB", "TB",
			"KTB" };
	public static final String[] FILE_SIZE_ARR = UNIT_SIZE;
	public static final String CMD_SHORT="cmd /c ";
	private SystemHWUtil() {
		throw new Error("Don't let anyone instantiate this class.");
	}

	
}
